<?php
/*
 * DESC :入口配置管理
 * Author:Oven
 * Date:2017-7-25
 */


define('DXW_BASECACHE_DIR', DXW_SOURCE_DIR_GLOBEL_DIR.'cache'.DXW_DS."cache".DXW_DS);	//根缓存路径。

define('DXW_PRO_CACHE_DIR', DXW_BASECACHE_DIR.DXW_PRO_NAME);			//项目缓存路径。

define('DXW_LOGS_DIR', 		DXW_SOURCE_DIR_GLOBEL_DIR.'cache'.DXW_DS.'logs'.DXW_DS);	//根日志路径。

define('DXW_PRO_LOG_DIR', 	DXW_LOGS_DIR.DXW_PRO_NAME );				//项目日志路径，Yii的常量
define('DXW_CACHE_FILE', 	DXW_BASECACHE_DIR."file".DXW_DS );				//项目日志路径，Yii的常量


define("DXW_LIBS_DIR",DXW_SOURCE_DIR."libs".DXW_DS);
//session超时时间
define("DXW_SESSION_TIMEOUT",3600);


define('DXW_SESSION_DIR',   DXW_BASECACHE_DIR.'session');                          //会话保存目录
define('DXW_COMMON_DIR', 	DXW_LIBS_DIR.'common'.DXW_DS);								//公用模块路径
define('DXW_MODULES_DIR', 	DXW_COMMON_DIR.'modules'.DXW_DS );							//公用模块路径

//公用函数设置
require_once (DXW_MODULES_DIR.'functions.php');
//themes路径
define("DXW_THEMES",DXW_SOURCE_DIR.DXW_PRO_NAME.DXW_DS."themes".DXW_DS);
//主域名定义
define("DOMAIN","xcydhn.com");
define("HOME_URL","http://www.".DOMAIN);
define("H5_URL","https://uch5-csga.".DOMAIN);
define("API_URL","https://api.".DOMAIN);
//文件地址

define("ADMIN_URL","https://admin.".DOMAIN);
define("FILE_URL",'http://file.'.DOMAIN);
//文件上传地址
define("DXW_FILE_UPLOAD_ADDR",DXW_SOURCE_DIR.'file/upload/');

ini_set( 'session.cookie_domain', '.'.DOMAIN );
// 定义默认图片地址
defined("DXW_MR_PIC")  or define("DXW_MR_PIC","/themes/images/moren.jpg");

//redis端口和IP定义
//define("DXW_REDIS_ADDR","redis-f84fcf8-dcs-8aw5.dcs.huaweicloud.com");
//define("DXW_REDIS_PORT","6379");
//define("DXW_REDIS_PWD","TdvtY_W4DMTQlwuF");
//define("DXW_REDIS_DB_INDEX",2);
define("DXW_REDIS_ADDR","127.0.0.1");
define("DXW_REDIS_PORT","6379");
define("DXW_REDIS_PWD","rHCOJa6eEp06j2");
define("DXW_REDIS_DB_INDEX",2);


//短网址生成源
//baidu.com ,suo.im,u6.gg,kks.me,c7.gg,rrd.me,t.cnze
define("DXW_DWZ_SOURCE","t.cn");
define("DXW_CACHE_CONF",DXW_SOURCE_DIR."cache/conf".DXW_DS);

include (DXW_SOURCE_DIR."/config/common.php");

$config	= DXW_SOURCE_DIR.DXW_PRO_NAME.'/protected/config/main.php';
define('YII_DEBUG', true);
$yii	= DXW_LIBS_DIR.'/yii/yii.php';			//	yii框架目录
require ($yii);												//	引入yii框架
Yii::createWebApplication($config)->run();					//	创建一个 yii web 应用
